package com.neuedu.shixun.hospital2.controller;

import com.neuedu.shixun.hospital2.entity.Depart;
import com.neuedu.shixun.hospital2.service.DepartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/depart")
@CrossOrigin
public class DepartController {
    @Autowired
    private DepartService departService;
    @GetMapping("getAll")
    public List<Depart> getAll(){
       return departService.getAll();
    }
}
